import request from '@/utils/request'

export default {
  getHospList(page, limit, searchObj) {//医院列表
    return request({
      url: `/admin/hosp/hospital/list/${page}/${limit}`,
      method: 'get',
      //不是post请求不用data传递数据，使用params，把参数放入请求体参数中来
      params: searchObj
    })
  },

  //根据dictCode查询所有省
  findByDictCode(dictCode) {
    return request({
      url: `/admin/cmn/dict/findByDictCode/${dictCode}`,
      method: 'get'
    })
  },
  //根据父亲id查询下面所有的市
  findParentId(id) {
    return request({
      url: `/admin/cmn/dict/findChildData/${id}`,
      method: 'get'
    })
  },
  //更新医院状态
  updateStatus(id,status){
    return request({
      url: `/admin/hosp/hospital/updateStatus/${id}/${status}`,
      method: 'get'
    })
  },
  //获取医院详情
  getHospById(id){
    return request({
      url: `/admin/hosp/hospital/showHospDetail/${id}`,
      method: 'get'
    })
  },
  //查看医院科室
  getDepartmentByHoscode(hoscode){
    return request({
      url: `/admin/hosp/department/getDeptList/${hoscode}`,
      method: 'get'
    })
  },
  getScheduleRule(page,limit,hoscode,depcode){
    return request({
      url: `/admin/hosp/schedule/getScheduleRule/${page}/${limit}/${hoscode}/${depcode}`,
      method: 'get'
    })
  },
  //查询排班详情日期
  getScheduleDetail(hoscode,depcode,workDate){
    return request({
      url: `/admin/hosp/schedule/getScheduleDetail/${hoscode}/${depcode}/${workDate}`,
      method: 'get'
    })
  }


}
